Skip to content

Fix getAssetsIndex task for FG1.0#1075

Open
zeng-github01 wants to merge 2 commits into
MinecraftForge:FG_1.0from
zeng-github01:FG_1.0-assets-download
Open

Fix getAssetsIndex task for FG1.0#1075
zeng-github01 wants to merge 2 commits into
MinecraftForge:FG_1.0from
zeng-github01:FG_1.0-assets-download

Conversation

@zeng-github01
Copy link
Copy Markdown

@zeng-github01 zeng-github01 commented May 18, 2026

@LexManos Please review it

@zeng-github01 zeng-github01 force-pushed the FG_1.0-assets-download branch from 954e0eb to 57c9ee0 Compare May 18, 2026 12:31
public static final OperatingSystem OPERATING_SYSTEM = getOs();
public static final SystemArch SYSTEM_ARCH = getArch();
public static final String HASH_FUNC = "MD5";
public static final String USER_AGENT = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not run code formatters over existing code.
It makes your entire change set a pain to actually read/understand

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I formatted it on a whim, do I need to undo it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, code changes should be actual changes not formatting. It makes it a pain to see what you actually changed.

public static final String FERNFLOWER = "{CACHE_DIR}/minecraft/fernflower.jar";
public static final String EXCEPTOR = "{CACHE_DIR}/minecraft/exceptor.jar";
public static final String ASSETS = "{CACHE_DIR}/minecraft/assets";
public static final String JSONS_DIR = "{CACHE_DIR}/minecraft/versionJsons";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use upper cases in directory names

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This path was copied directly from FG 1.2, which allows resource files to be stored together with other versions of FG. Do you think it needs to be changed?

@LexManos
Copy link
Copy Markdown
Member

Ya, gave this another pass, can you provide an example buildscript that you've used to test this?
I can't get this to function so im trying to see what you're seeing.

@zeng-github01
Copy link
Copy Markdown
Author

zeng-github01 commented May 23, 2026

Ya, gave this another pass, can you provide an example buildscript that you've used to test this?
I can't get this to function so im trying to see what you're seeing.

buildscript {
    repositories {
        mavenCentral()
        maven { url uri('local-maven') }
        maven {
            name = "forge"
            url = "https://files.minecraftforge.net/maven"
        }
    }
    dependencies {
        classpath 'net.minecraftforge.gradle:ForgeGradle:1.0.3'
    }
}

apply plugin: 'forge'

sourceCompatibility = '1.7'
targetCompatibility = '1.7'

version = "1.0"
group = "org.Example"
archivesBaseName = "Example"

minecraft {
    version = "1.6.4-9.11.1.964"
    //Apply AccessTransformer here uncomment below
//    accessTransformer("")
}

repositories {
    maven { url "https://cursemaven.com" }
}

dependencies {
}

processResources {
    duplicatesStrategy = DuplicatesStrategy.INCLUDE

    inputs.property "version", project.version

    from(sourceSets.main.resources.srcDirs) {
        include 'mcmod.info'
        expand 'version': project.version
    }
    from(sourceSets.main.resources.srcDirs) {
        exclude 'mcmod.info'
    }
}

jar {
    manifest {
        attributes(
                "FMLCorePlugin": "com.example.MinecraftModifier",
                "FMLCorePluginContainsFMLMod": "true"
        )
    }
}

task deobfJar(type: Jar) {
    from sourceSets.main.output

    classifier = 'dev'
}



artifacts {
    archives deobfJar
}

This is a development package I packaged locally, similar to MDK 1.7.10. This is the build script it uses. It uses Gradle 4.

The version numbers might be inconsistent because the Gradle version wasn't upgraded in the PR. I remember seeing this PR with version 1.0.1

@zeng-github01
Copy link
Copy Markdown
Author

Ya, gave this another pass, can you provide an example buildscript that you've used to test this?
I can't get this to function so im trying to see what you're seeing.

The script has been provided; I recall that setupWorkspace and build are both available.

import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
Copy link
Copy Markdown
Member

@LexManos LexManos May 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

java.nio doesnt exist in java 6 Which is required to decompile the game correctly due to bugs in fernflower.
java.nio.file.Files was added in java 7
FG 1.2 works fine with this because it uses an updated Fernflower with stabilization

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm considering whether to upgrade compatibility to Java 7 or 8. Java 6 is practically obsolete.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are several other places that also mention the 1.7 API, but I don't know why they don't affect compilation.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They dont effect compilation because youre using the system java to compile. Which is probably java 8+

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm considering whether to upgrade compatibility to Java 7 or 8. Java 6 is practically obsolete.

Yes, there isnt even a distro for modern macs. Which is what im running into for mavenizer.

But its not possible to bump the required java version until the fernflower issues i stated are fixed.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested it locally, and directly upgrading the version didn't reveal any bugs. I've even compiled and run the mod using my fixed FG. So I want to know what the problem is.

@LexManos
Copy link
Copy Markdown
Member

Alright, so needed to get a functional FG1.1 branch up and running.
So I took at stab at fixing the downloading of assets for that branch.
You can see how it should be done in my commit LexManos@367864a
The reason I haven't pushed to production is that it doesn't actually setup a 1.7.2-10.12.0.967 workspace correctly.

Part of my blocker is that sonatype has died, and thus the SpecialSource snapshot we use for deobf is gone.
Any chance you have a mirror/download for that versions?
The other issue is that java 7 does not have modern root authorities, so you have to run with a hybrid java 7 and 8 workspace.
I'm working on getting a solution to that, but I need to get a copy of the old SpecialSource to help me in that endevor.

Once I fix the Fernflower on Java 8 issue, it'll let me complete my current project of Mavenizer support for FG 1 & 2. Which means 1.6.4->1.12.2 will work on FG7. (Currently I have 1.8-1.12.2 working as they use a fixed FernFlower)

But, im off for a while. So if you can look into that and let me know that'd be great. Else i'll look into it when i get back home.

@zeng-github01 zeng-github01 force-pushed the FG_1.0-assets-download branch from 420c284 to b5cc10e Compare May 24, 2026 01:41
@zeng-github01
Copy link
Copy Markdown
Author

Sorry, I don't have this version of SpecialSource either. I found that there seems to be a 1.7.2 version of SpecialSource in the central Maven repository. Can't use this one?

@LexManos
Copy link
Copy Markdown
Member

Sorry, I don't have this version of SpecialSource either. I found that there seems to be a 1.7.2 version of SpecialSource in the central Maven repository. Can't use this one?

Naw, there are behavioral differences between those versions that cause decompile to break

@zeng-github01
Copy link
Copy Markdown
Author

Naw, there are behavioral differences between those versions that cause decompile to break

That's terrible news.

@zeng-github01
Copy link
Copy Markdown
Author

zeng-github01 commented May 24, 2026

@LexManos Could you recompile this specific version? I've found the corresponding commit.

md-5/SpecialSource@1addd1b

@LexManos
Copy link
Copy Markdown
Member

Its one of these builds LexManos/SpecialSource@1addd1b...e1ab7c7
I'll grind through and check tomarrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants